<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Category extends MY_Controller {
    
    public function index()
    {
        $this->setHeader('title', '地区标志');
        $this->navigation();
                
        $parm['where'] = array(
            'types'=>'topic',
            'm.type'=>'category'
        );
        $thisData['texts'] = $this->Entries->getTopic($parm, $this->uri->segment(2), $this->pageLimit);
        $config['base_url']         = base_url().'/category/';
        $config['total_rows']       = $this->Entries->getTopicCount($parm);
        $config['per_page']         = $this->pageLimit;
        $config['uri_segment']      = 2;
        $config['use_page_numbers']	= true;
        $this->pagination->initialize($config);
        
        $thisData['tags'] = $this->tags();
        $thisData['monographics'] = $this->monographics();
        $thisData['culture'] = $this->culture();
        $thisData['policy'] = $this->policy();
        $thisData['news'] = $this->news();
        
        $this->load->view('category' ,$thisData);
    }
    
    public function author()
    {
        $this->setHeader('title', '分类');
        $this->navigation();
        
        $parm['where'] = array(
            'types'=>'topic',
            'e.uid'=>$this->uri->segment(2)
        );
        $thisData['texts'] = $this->Entries->getTopic($parm);
        $thisData['tags'] = $this->tags();
        $thisData['hot'] = $this->hots();
        $thisData['culture'] = $this->culture();
        $thisData['policy'] = $this->policy();
        $thisData['news'] = $this->news();
        $this->load->view('category' ,$thisData);
    }
}